      module allocs
      
      use param

      interface dmalloc
         module procedure mallocf1
         module procedure mallocd1
         module procedure malloci1
         module procedure mallocl1
         module procedure mallocf2
         module procedure mallocd2
         module procedure malloci2
         module procedure mallocl2
         module procedure mallocf3
         module procedure mallocd3
         module procedure malloci3
         module procedure mallocf4
         module procedure mallocd4
         module procedure malloci4
      end interface
      interface dmalloc0
         module procedure mallocf01
         module procedure mallocd01
         module procedure malloci01
         module procedure mallocf02
         module procedure mallocd02
         module procedure malloci02
         module procedure mallocf03
         module procedure mallocd03
         module procedure malloci03
         module procedure mallocf04
         module procedure mallocd04
         module procedure malloci04
      end interface

      contains

      subroutine mallocf1(a,n1)
      include 'ntbytes.h'
      real(4),pointer :: a(:)
      allocate(a(n1))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocd1(a,n1)
      include 'ntbytes.h'
      real(8),pointer :: a(:)
      allocate(a(n1))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine malloci1(a,n1)
      include 'ntbytes.h'
      integer,pointer :: a(:)
      allocate(a(n1))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocl1(a,n1)
      include 'ntbytes.h'
      logical,pointer :: a(:)
      allocate(a(n1))
      a=.FALSE.
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocf2(a,n1,n2)
      include 'ntbytes.h'
      real(4),pointer :: a(:,:)
      allocate(a(n1,n2))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocd2(a,n1,n2)
      include 'ntbytes.h'
      real(8),pointer :: a(:,:)
      allocate(a(n1,n2))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine malloci2(a,n1,n2)
      include 'ntbytes.h'
      integer,pointer :: a(:,:)
      allocate(a(n1,n2))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocl2(a,n1,n2)
      include 'ntbytes.h'
      logical,pointer :: a(:,:)
      allocate(a(n1,n2))
      a=.FALSE.
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocf3(a,n1,n2,n3)
      include 'ntbytes.h'
      real(4),pointer :: a(:,:,:)
      allocate(a(n1,n2,n3))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocd3(a,n1,n2,n3)
      include 'ntbytes.h'
      real(8),pointer :: a(:,:,:)
      allocate(a(n1,n2,n3))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine malloci3(a,n1,n2,n3)
      include 'ntbytes.h'
      integer,pointer :: a(:,:,:)
      allocate(a(n1,n2,n3))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocf4(a,n1,n2,n3,n4)
      include 'ntbytes.h'
      real(4),pointer :: a(:,:,:,:)
      allocate(a(n1,n2,n3,n4))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocd4(a,n1,n2,n3,n4)
      include 'ntbytes.h'
      real(8),pointer :: a(:,:,:,:)
      allocate(a(n1,n2,n3,n4))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine malloci4(a,n1,n2,n3,n4)
      include 'ntbytes.h'
      integer,pointer :: a(:,:,:,:)
      allocate(a(n1,n2,n3,n4))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocf01(a,nb1,ne1)
      include 'ntbytes.h'
      real(4),pointer :: a(:)
      allocate(a(nb1:ne1))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocd01(a,nb1,ne1)
      include 'ntbytes.h'
      real(8),pointer :: a(:)
      allocate(a(nb1:ne1))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine malloci01(a,nb1,ne1)
      include 'ntbytes.h'
      integer,pointer :: a(:)
      allocate(a(nb1:ne1))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocf02(a,nb1,ne1,nb2,ne2)
      include 'ntbytes.h'
      real(4),pointer :: a(:,:)
      allocate(a(nb1:ne1,nb2:ne2))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocd02(a,nb1,ne1,nb2,ne2)
      include 'ntbytes.h'
      real(8),pointer :: a(:,:)
      allocate(a(nb1:ne1,nb2:ne2))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine malloci02(a,nb1,ne1,nb2,ne2)
      include 'ntbytes.h'
      integer,pointer :: a(:,:)
      allocate(a(nb1:ne1,nb2:ne2))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocf03(a,nb1,ne1,nb2,ne2,nb3,ne3)
      include 'ntbytes.h'
      real(4),pointer :: a(:,:,:)
      allocate(a(nb1:ne1,nb2:ne2,nb3:ne3))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocd03(a,nb1,ne1,nb2,ne2,nb3,ne3)
      include 'ntbytes.h'
      real(8),pointer :: a(:,:,:)
      allocate(a(nb1:ne1,nb2:ne2,nb3:ne3))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine malloci03(a,nb1,ne1,nb2,ne2,nb3,ne3)
      include 'ntbytes.h'
      integer,pointer :: a(:,:,:)
      allocate(a(nb1:ne1,nb2:ne2,nb3:ne3))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocf04(a,nb1,ne1,nb2,ne2,nb3,ne3,nb4,ne4)
      include 'ntbytes.h'
      real(4),pointer :: a(:,:,:,:)
      allocate(a(nb1:ne1,nb2:ne2,nb3:ne3,nb4:ne4))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine mallocd04(a,nb1,ne1,nb2,ne2,nb3,ne3,nb4,ne4)
      include 'ntbytes.h'
      real(8),pointer :: a(:,:,:,:)
      allocate(a(nb1:ne1,nb2:ne2,nb3:ne3,nb4:ne4))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine
!
      subroutine malloci04(a,nb1,ne1,nb2,ne2,nb3,ne3,nb4,ne4)
      include 'ntbytes.h'
      integer,pointer :: a(:,:,:,:)
      allocate(a(nb1:ne1,nb2:ne2,nb3:ne3,nb4:ne4))
      a=0
      nbytesf=nbytesf+size(a)
      end subroutine

      end module
